<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import { useNovelStore } from './stores/novel.js'
import { useAuthStore } from './stores/authStore.js'

const store = useNovelStore()
const authStore = useAuthStore()

onMounted(async () => {
  // 初始化主题
  authStore.initTheme()
  
  // 初始化API配置
  try {
    await store.initializeApiConfig()
  } catch (error) {
    console.error('初始化API配置失败:', error)
  }
})
</script>

<style>
#app {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}
</style>